@echo off
setlocal enabledelayedexpansion

echo Fixing jakarta imports to javax...

REM Fix validation imports
for /r "ruoyi-common\src" %%f in (*.java) do (
    powershell -Command "(Get-Content '%%f') -replace 'import jakarta\.validation\.', 'import javax.validation.' | Set-Content '%%f'"
)

REM Fix servlet imports
for /r "ruoyi-common\src" %%f in (*.java) do (
    powershell -Command "(Get-Content '%%f') -replace 'import jakarta\.servlet\.', 'import javax.servlet.' | Set-Content '%%f'"
)

echo All imports fixed!
pause
